package linearList.text;


import linearList.LinkList;

public class LinkListDemo {
    public static void main(String[] args) {
        LinkList<String> list = new LinkList<>();
        list.insert("张三");
        list.insert("李四");
        list.insert("王五");
        list.insert("赵六");
        //测试length方法
        for (String s : list) {
            System.out.print(s+"  ");
        }
        System.out.println(list.length());
        System.out.println("-----------------------");
        list.insert(0,"11");
        list.insert(1,"22");
        list.insert(2,"33");
        list.insert(3,"44");
        for (String s : list) {
            System.out.print(s+"  ");
        }
        System.out.println(list.index("33"));
        System.out.println(list.indexOf("33"));
        System.out.println(list);

        list.reverse();

        for (String s : list) {
            System.out.print(s+"  ");
        }
    }

}
